//
//  LBPageMenu.h
//  LBPageMenu
//
//  Created by Apple on 2021/9/21.
//

#import <UIKit/UIKit.h>
#import "LBPageMenuConfiguration.h"

NS_ASSUME_NONNULL_BEGIN

@class LBPageMenu;

@protocol LBPageMenuDelegate <NSObject>

@optional
//点击某个item
- (void)selectItemAtIndex:(NSInteger)index;

@end

@interface LBPageMenu : UIView

- (instancetype)initWithFrame:(CGRect)frame configuration:(LBPageMenuConfiguration *)configuration NS_DESIGNATED_INITIALIZER;

- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;

- (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;

/**
 *  传递数组(数组元素只能是NSString)
 *
 *  @param items    数组
 *  @param selectedItemIndex  选中哪个item
 */
- (void)setItems:(nullable NSArray <NSString *> *)items selectedItemIndex:(NSUInteger)selectedItemIndex;
/** 关闭跟踪器的跟随效果,在外界传了scrollView进来或者调用了moveTrackerFollowScrollView的情况下,如果为YES，则当外界滑动scrollView时，跟踪器不会时刻跟随,只有滑动结束才会跟踪; 如果为NO，跟踪器会时刻跟随scrollView */
@property (nonatomic, assign) BOOL closeTrackerFollowingMode;

/** 代理 */
@property (nonatomic, weak) id<LBPageMenuDelegate> delegate;

//跟踪滚动
- (void)beginMoveTrackerFollowScrollView:(UIScrollView *)scrollView;

@end

NS_ASSUME_NONNULL_END
